# 
# To change this template, choose Tools | Templates
# and open the template in the editor.
 

$:.unshift File.join(File.dirname(__FILE__),'..','lib')

require 'test/unit'
require 'carro_compra'
require 'producto'

class TestCarroCompra < Test::Unit::TestCase
  def test_add
    p1 = Producto.new("leche", 10)
    p2 = Producto.new("carne", 20)
    
    carro = CarroCompra.new
    carro.add(p1)
    carro.add(p2)
    
    assert_equal p1, carro[0]
    assert_equal p2, carro[1]
    assert_equal(carro.size, 2)
  end
end
